package org.example.task;

import org.example.service.ApplicationStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author wwy
 * @date 2020-11-29 16:01
 */
@Component
public class TaskApp {
    @Autowired
    private ApplicationStatusService applicationStatusService;

    /**
     * 定时获取启动jar状态列表
     */
    @PostConstruct
    @Scheduled(cron = "0/2 * * * * ? ")
    public void taskJarStatus(){
        applicationStatusService.statusDetection();
    }
}
